<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main"/>

    <g:set var="entityName" value="${message(code: 'opportunity.label', default: 'Opportunity')}"/>
    <title>详情</title>
</head>

<body>
<input type="hidden" value="${this.opportunity?.id}" id="opportunityId">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body clearfix">
            <h2 class="font-light pull-left">
                订单号: ${this.opportunity.serialNumber}
            </h2>

            <div id="navbar-example" class="pull-right href-link">
                <ul class="nav navbar-nav" role="tablist">
                    <li class="active"><a class="btn-link page-scroll" href="#first">订单基本信息</a></li>
                    <li><a class="btn-link page-scroll" page-scroll="" href="#second">报单人信息</a></li>
                    <li><a class="btn-link page-scroll" page-scroll="" href="#third">借款人信息</a></li>
                    <li><a class="btn-link page-scroll" page-scroll="" href="#sixth">影像资料</a></li>
                </ul>
            </div>

        </div>
    </div>
</div>

<div class="content active animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
            </div>
        </g:if>
        <g:hasErrors bean="${this.opportunityTeam}">
            <ul class="errors" role="alert">
                <g:eachError bean="${this.opportunityTeam}" var="error">
                    <li>
                        <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>
                        <g:message error="${error}"/>
                    </li>
                </g:eachError>
            </ul>
        </g:hasErrors>
        <div id="hbreadcrumb" class="pull-left">
            <ol class="hbreadcrumb breadcrumb m-t-none">
                <li>贷款管理系统</li>
                <li>
                    <g:link controller="opportunityTeam" action="index">订单管理</g:link>
                </li>
                <li class="active">
                    <span>信息查看</span>
                </li>
            </ol>
        </div>

        <div class="pull-right">

        </div>

    </div>

    <div class="row" id="first">
        <div class="hpanel hred contact-panel">
            <div class="panel-heading">
                <div class="panel-tools">

                </div>
                订单基本信息
            </div>

            <div class="panel-body">
                <h4>
                    ${this.opportunity.serialNumber}


                </h4>

                <div class="col-md-3">
                    <strong>
                        <span class="glyphicon glyphicon-user"
                              aria-hidden="true"></span> <span class="nameFormat">${this.opportunity?.fullName}</span>
                    </strong>
                </div>

                <div class="col-md-3">
                    <strong>产品类型：${this.opportunity?.product?.name}</strong>
                </div>

                <g:if test="${this.opportunity?.status == 'Failed'}"><span
                        class="label label-danger pull-right">订单结果：失败</span></g:if>
                <g:elseif test="${this.opportunity?.status == 'Completed'}"><span
                        class="label label-success pull-right">订单结果：成功</span></g:elseif>
                <g:else><span class="label label-info pull-right">订单结果：进行中</span></g:else>
            </div>


        </div>
    </div>

    <div class="row" id="second">
        <div class="hpanel hred">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                报单人信息
            </div>

            <div class="panel-body">
                <div class="row">
                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>归属客户经理</span>
                            <strong>
                                <span class="nameFormat">${this.opportunity?.user?.fullName}</span>
                            </strong>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>客户经理手机号</span>
                            <strong class="cellphoneFormat">${this.opportunity?.user?.cellphone}</strong>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>渠道名称</span>
                            <strong>${this.opportunity?.account?.parent?.name}</strong>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>商户名称</span>
                            <strong><span class="nameFormat">${this.opportunity?.account?.name}</span></strong>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>客户经理机构名称</span>
                            <strong>${this.opportunity?.user?.account?.name}</strong>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div class="row" id="third">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                借款人信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="type" title="联系人"></g:sortableColumn>
                            <g:sortableColumn property="fullName" title="姓名"></g:sortableColumn>
                            <g:sortableColumn property="cellphone" title="手机号"></g:sortableColumn>
                            <g:sortableColumn property="idNumber" title="身份证号"></g:sortableColumn>
                            <g:sortableColumn property="maritalStatus" title="婚姻状态"></g:sortableColumn>
                            <g:sortableColumn property="age" title="性别"></g:sortableColumn>
                            <g:sortableColumn property="profession" title="学历"></g:sortableColumn>
                            <g:sortableColumn property="country" title="行业类型"></g:sortableColumn>
                            <g:sortableColumn property="identityType" title="现单位工作年限"></g:sortableColumn>
                            <g:sortableColumn property="identityType" title="职位等级"></g:sortableColumn>
                            <g:sortableColumn property="identityType" title="平均月收入"></g:sortableColumn>
                            <g:sortableColumn property="identityType" title="是否有房产"></g:sortableColumn>
                            <g:sortableColumn property="connnectedContact" title="关联人"></g:sortableColumn>
                            <g:sortableColumn property="connectedType" title="关联关系"></g:sortableColumn>

                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${this.opportunityContacts}">
                            <tr>
                                <td>

                                        <g:link controller="bocOpportunityContact" action="show"
                                                id="${it?.id}">${it?.type?.name}</g:link>

                                </td>
                                <td>
                                    ${it?.contact?.fullName}
                                </td>
                                <td>
                                    ${it?.contact?.cellphone}
                                </td>
                                <td>
                                    ${it?.contact?.idNumber}
                                </td>

                                <td>
                                    ${it?.contact?.maritalStatus}
                                </td>
                                <td>
                                    ${it?.contact?.gender}
                                </td>
                                <td>
                                    ${it?.contact?.certificate?.name}
                                </td>
                                <td>
                                    ${it?.contact?.industry?.name}
                                </td>
                                <td>
                                    ${it?.contact?.currentSeniority}
                                </td>
                                <td>
                                    ${it?.contact?.jobLevel}
                                </td>
                                <td>
                                    ${it?.contact?.monthlyIncome}
                                </td>
                                <td>
                                    ${it?.contact?.houseOwner}
                                </td>

                                <td>
                                    <span>${it?.connectedContact?.fullName}</span>
                                </td>
                                <td>
                                    ${it?.connectedType?.name}
                                </td>

                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row" id="fourth">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                交易信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                          <g:sortableColumn property="type" title="商户名称"></g:sortableColumn>
                            <g:sortableColumn property="type" title="产品名称"></g:sortableColumn>
                            <g:sortableColumn property="fullName" title="贷款申请金额（元）"></g:sortableColumn>
                            <g:sortableColumn property="cellphone" title="贷款期数"></g:sortableColumn>
                            <g:sortableColumn property="cellphone" title="费率"></g:sortableColumn>
                            <g:sortableColumn property="idNumber" title="订单总金额"></g:sortableColumn>
                            <g:sortableColumn property="age" title="支付方式"></g:sortableColumn>
                            <g:sortableColumn property="maritalStatus" title="预审金额"></g:sortableColumn>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                              <td>
                                <g:if test="${com.next.Vehicle.findByOpportunity(this.opportunity)}">
                                  <g:link controller="bocVehicle" action="tradeInfo" id="${com.next.Vehicle.findByOpportunity(this.opportunity)?.id}">
                                  ${this.opportunity?.account?.name}
                                </g:link>
                                    </g:if>
                                  <g:else>
                                  ${this.opportunity?.account?.name}
                                </g:else></td>
                              <td>${this.opportunity?.product?.name}</td>
                              <td>${this.opportunity?.requestedAmount}</td>
                              <td>${this.opportunity?.loanDuration}</td>
                              <td>${this.opportunity?.commissionRate}</td>
                              <td>${this.opportunity?.loanAmount}</td>
                              <td>${this.opportunity?.principalPaymentMethod?.name}</td>
                              <td>${this.opportunity?.maximumAmountOfCredit}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                职业信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                          <g:sortableColumn property="type" title="现工作单位"></g:sortableColumn>
                          <g:sortableColumn property="type" title="工作单位地址"></g:sortableColumn>
                          <g:sortableColumn property="type" title="工作单位邮编"></g:sortableColumn>
                          <g:sortableColumn property="type" title="工作单位电话"></g:sortableColumn>
                          <g:sortableColumn property="type" title="本单位行业"></g:sortableColumn>
                          <g:sortableColumn property="type" title="经济类型"></g:sortableColumn>
                          <g:sortableColumn property="type" title="职业"></g:sortableColumn>
                          <g:sortableColumn property="type" title="职称"></g:sortableColumn>
                          <g:sortableColumn property="type" title="职务"></g:sortableColumn>
                          <g:sortableColumn property="type" title="参加工作日期"></g:sortableColumn>
                          <g:sortableColumn property="type" title="现工作日期"></g:sortableColumn>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                              <td>${this.opportunity?.contact?.companyName}</td>
                              <td>${this.opportunity?.contact?.companyAddress}</td>
                              <td>${this.opportunity?.contact?.companyZipCode}</td>
                              <td>${this.opportunity?.contact?.companyPhone}</td>
                              <td>${this.opportunity?.contact?.industry?.name}</td>
                              <td>${this.opportunity?.contact?.companyEconomyType?.name}</td>
                              <td>${this.opportunity?.contact?.profession?.name}</td>
                              <td>${this.opportunity?.contact?.professionTile?.name}</td>
                              <td>${this.opportunity?.contact?.contactJob?.name}</td>
                              <td>${this.opportunity?.contact?.workTime}</td>
                              <td>${this.opportunity?.contact?.currentWorkTime}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                资产负债信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                          <g:sortableColumn property="type" title="银行往来情况"></g:sortableColumn>
                          <g:sortableColumn property="type" title="成为中行客户时间"></g:sortableColumn>
                          <g:sortableColumn property="type" title="主借款人收入（元）"></g:sortableColumn>
                          <g:sortableColumn property="type" title="借款人收入类型"></g:sortableColumn>
                          <g:sortableColumn property="type" title="借款人月收入验证方式"></g:sortableColumn>
                          <g:sortableColumn property="type" title="家庭其他成员月收入"></g:sortableColumn>
                          <g:sortableColumn property="type" title="家庭其他成员月收入验证方式"></g:sortableColumn>
                          <g:sortableColumn property="type" title="现住房种类"></g:sortableColumn>
                          <g:sortableColumn property="type" title="持卡情况"></g:sortableColumn>
                          <g:sortableColumn property="type" title="家庭成员数"></g:sortableColumn>
                          <g:sortableColumn property="type" title="供养人口数"></g:sortableColumn>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                              <td><g:link controller="bocContact" action="assetInfo" id="${this.opportunity?.contact?.id}">${this.opportunity?.contact?.bankDealings}</g:link></td>
                              <td>${this.opportunity?.contact?.beCustomerDuration}</td>
                              <td>${this.opportunity?.contact?.monthlyIncome}</td>
                              <td>${this.opportunity?.contact?.monthlyIncomeType}</td>
                              <td>${this.opportunity?.contact?.monthlyIncomeVerifyMethod}</td>
                              <td>${this.opportunity?.contact?.otherMembersMonthlyIncome}</td>
                              <td>${this.opportunity?.contact?.otherMembersMonthlyIncomeVerifyMethod}</td>
                              <td>${this.opportunity?.contact?.houseType?.name}</td>
                              <td>${this.opportunity?.contact?.cardCountRange}</td>
                              <td>${this.opportunity?.contact?.familyMembersCount}</td>
                              <td>${this.opportunity?.contact?.fendCount}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                信用卡产品信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                          <g:sortableColumn property="type" title="信用卡卡号"></g:sortableColumn>
                          <g:sortableColumn property="type" title="是否实时发卡"></g:sortableColumn>
                          <g:sortableColumn property="type" title="账单卡片寄送地址"></g:sortableColumn>
                          <g:sortableColumn property="type" title="对账单发送方式"></g:sortableColumn>
                          <g:sortableColumn property="type" title="住宅性质"></g:sortableColumn>
                          <g:sortableColumn property="type" title="还款方式"></g:sortableColumn>
                          <g:sortableColumn property="type" title="开户行所在省"></g:sortableColumn>
                          <g:sortableColumn property="type" title="人民币卡号"></g:sortableColumn>
                          <g:sortableColumn property="type" title="优先级"></g:sortableColumn>
                          <g:sortableColumn property="type" title="卡片代码"></g:sortableColumn>
                        </tr>
                        </thead>
                        <tbody>
                          <g:each in="${this.opportunityBankAccounts}">
                          <g:if test="${it?.bankAccount?.type?.name == '信用卡'}">
                            <tr>
                              <td><g:link controller="bocBankAccount" action="creditCardInfo" id="${it?.bankAccount?.id}">${it?.bankAccount?.numberOfAccount}</g:link></td>
                              <td>${it?.bankAccount?.isIssuingCardImmediately}</td>
                              <td>${it?.bankAccount?.postAddress}</td>
                              <td>${it?.bankAccount?.billSentMethod}</td>
                              <td>${it?.bankAccount?.houseProperty}</td>
                              <td>${it?.bankAccount?.creditCardPaymentMethod}</td>
                              <td>${it?.bankAccount?.province?.name}</td>
                              <td>${com.next.BankAccount.findByParent(it?.bankAccount)}?.numberOfAccount</td>
                              <td>${it?.bankAccount?.priority}</td>
                              <td>${it?.bankAccount?.code}</td>
                            </tr>
                          </g:if>
                            </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                申请分期信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                          <g:sortableColumn property="type" title="分期类型"></g:sortableColumn>
                          <g:sortableColumn property="type" title="申请额度"></g:sortableColumn>
                          <g:sortableColumn property="type" title="手续费分期"></g:sortableColumn>
                          <g:sortableColumn property="type" title="还款周期"></g:sortableColumn>
                          <g:sortableColumn property="type" title="本金还款方式"></g:sortableColumn>
                          <g:sortableColumn property="type" title="分期期数"></g:sortableColumn>
                          <g:sortableColumn property="type" title="手续费"></g:sortableColumn>
                          <g:sortableColumn property="type" title="担保类型"></g:sortableColumn>
                          <g:sortableColumn property="type" title="担保品修改标识"></g:sortableColumn>
                        </tr>
                        </thead>
                        <tbody>

                            <tr>
                              <td>${this.opportunity?.subtype?.name}</td>
                              <td>${this.opportunity?.requestedAmount}</td>
                              <td>${this.opportunity?.commissionPaymentMethod?.name}</td>
                              <td>${this.opportunity?.repaymentPeriod}</td>
                              <td>${this.opportunity?.principalPaymentMethod?.name}</td>
                              <td>${this.opportunity?.loanDuration}</td>
                              <td>${this.opportunity?.commission}</td>
                              <td>${this.opportunity?.guaranteeType?.name}</td>
                              <td>${this.opportunity?.collateralIsModified}</td>
                            </tr>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                交易信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                          <g:sortableColumn property="type" title="省份"></g:sortableColumn>
                          <g:sortableColumn property="type" title="城市"></g:sortableColumn>
                          <g:sortableColumn property="type" title="品牌"></g:sortableColumn>
                          <g:sortableColumn property="type" title="资金需求金额"></g:sortableColumn>

                        </tr>
                        </thead>
                        <tbody>

                            <tr>
                              <td>${this.opportunity?.contact?.province?.name}</td>
                              <td>${this.opportunity?.contact?.city?.name}</td>
                              <td>${this.opportunity?.brand}</td>
                              <td>${this.opportunity?.requestedAmount}</td>

                            </tr>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row" id="fifth">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                装修信息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>

                        <tr>
                          <g:sortableColumn property="type" title="购房时间"></g:sortableColumn>
                          <g:sortableColumn property="type" title="拟装修房产地址"></g:sortableColumn>
                          <g:sortableColumn property="type" title="购房价格"></g:sortableColumn>
                          <g:sortableColumn property="type" title="购房面积"></g:sortableColumn>
                          <g:sortableColumn property="type" title="购房信息"></g:sortableColumn>
                          <g:sortableColumn property="type" title="房产属性"></g:sortableColumn>
                          <g:sortableColumn property="type" title="预计交房时间"></g:sortableColumn>
                          <g:sortableColumn property="type" title="家装公司名称"></g:sortableColumn>
                          <g:sortableColumn property="type" title="装修合同签订时间"></g:sortableColumn>

                        </tr>

                        </thead>
                        <tbody>
                          <g:each in="${this.houses}">
                            <tr>
                              <td><g:link controller="bocHouse" action="houseDecorationInfo" id="${it?.id}">${it?.purchaseDate}</g:link></td>
                              <td>${it?.address}</td>
                              <td>${it?.purchaseAmount}</td>
                              <td>${it?.purchaseArea}</td>
                              <td>购房信息</td>
                              <td>${it?.houseProperty}</td>
                              <td>${it?.houseDeliveryDate}</td>
                              <td>${it?.decorationCompany}</td>
                              <td>${it?.decorationContractTime}</td>

                            </tr>
                          </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>


    <div class="row" id="sixth">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                影像资料
            </div>

            <div class="panel-body no-padding">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="horange">
                            <div class="panel-body float-e-margins" style="border-top: none;">
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '身份证']">身份证</g:link>
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '婚姻证明']">婚姻证明</g:link>
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '人脸识别照']">人脸识别照</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '客户合影照片']">客户合影照片</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '驾驶证']">驾驶证</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '户口本']">户口本</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '分期业务申请表']">分期业务申请表</g:link>
                            <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                    action="show" id="${this.opportunity.id}"
                                    params="[attachmentTypeName: '信息查询授权书']">信息查询授权书</g:link>
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '银行流水']">银行流水</g:link>
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '公积金']">公积金</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '社保']">社保</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '个税']">个税</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '营业执照']">营业执照</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '收入证明']">收入证明</g:link>
                            <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                    action="show" id="${this.opportunity.id}"
                                    params="[attachmentTypeName: '划付授权书']">划付授权书</g:link>
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '分期业务告知书']">分期业务告知书</g:link>
                                <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                        action="show" id="${this.opportunity.id}"
                                        params="[attachmentTypeName: '分期业务合同协议']">分期业务合同协议</g:link>
                              <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachments"
                                      action="show" id="${this.opportunity.id}"
                                      params="[attachmentTypeName: '面签']">面签</g:link>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                客户预警信息
            </div>

            <div class="panel-body">
                <g:each in="${this.opportunityFlexFieldCategorys}">

                    <g:if test="${it?.flexFieldCategory?.name in ['准入警示信息']}">
                        <div class="form form-horizontal">

                            <div class="form-group">
                                <label class="col-md-2 control-label">${it?.flexFieldCategory?.name}：</label>

                                <div class="col-md-10">
                                    <g:each in="${it?.fields}" var="field">
                                        <span class="cont text-comment">${field?.name}:${field?.value}</span>
                                    </g:each>
                                </div>
                            </div>

                        </div>
                    </g:if>

                </g:each>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                授信决策信息
            </div>

            <div class="panel-body">
                <g:each in="${this.opportunityFlexFieldCategorys}">

                    <g:if test="${it?.flexFieldCategory?.name in ['额度测算结果']}">
                        <div class="form form-horizontal">

                            <div class="form-group">
                                <label class="col-md-2 control-label">${it?.flexFieldCategory?.name}：</label>

                                <div class="col-md-10">
                                    <g:each in="${it?.fields}" var="field">
                                        <span class="cont text-comment">${field?.name}:${field?.value}</span>
                                    </g:each>
                                </div>
                            </div>

                        </div>
                    </g:if>

                </g:each>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                客户问卷
            </div>

            <div class="panel-body form-horizontal">
                <g:each in="${this.questionnaireInstance?.questions}" var="question">
                    <div class="form-group">
                    <g:if test="${question?.questionType == 'input'}">
                        <label class="col-md-8 control-label text-left">${question?.displayOrder}.${question?.name}：</label>

                        <div class="col-md-4" style="padding-top: 8px"><label>${question?.value}</label></div>
                    </g:if>
                    <g:elseif test="${question?.questionType == 'radio'}">
                        <label class="col-md-8 control-label text-left">${question?.displayOrder}.${question?.name}：${question?.value}</label>

                        <div class="col-md-4" style="padding-top: 8px">

                            <g:each in="${question?.options}" var="option">
                                <div class="">
                                    <label>
                                        <g:if test="${option?.selected}">

                                            <input class="i-checks" name="${option.name}" type="radio"
                                                   value="${option?.name}" checked disabled/> ${option?.name}

                                        </g:if>
                                        <g:else>
                                            <input class="i-checks" name="${option.name}" disabled
                                                   type="radio" value="${option?.name}"/> ${option?.name}
                                        </g:else>
                                    </label>
                                </div>
                            </g:each>

                        </div>
                    </g:elseif>
                    <g:elseif test="${question?.questionType == 'checkbox'}">
                        <label class="col-md-8 control-label text-left">${question?.displayOrder}.${question?.name}：${question?.value}</label>
                        <div class="col-md-4" style="padding-top: 8px">

                        <g:each in="${question?.options}" var="option">
                            <div class="">
                                <label>
                                    <g:if test="${option?.selected}">
                                        <input class="i-checks" name="${option.name}" type="checkbox"
                                               value="${option?.name}" checked disabled/> ${option?.name}
                                    </g:if>
                                    <g:else>
                                        <input class="i-checks" name="${option.name}" type="checkbox"
                                               value="${option?.name}" disabled/> ${option?.name}
                                    </g:else>
                                </label>
                            </div>
                        </g:each>
                      </div>
                    </g:elseif>

                  </div>
                </g:each>
            </div>
        </div>
</div>

<div class="row">
    <div class="hpanel hgreen collapsed">
        <div class="panel-heading hbuilt">
            <div class="panel-tools">

                <a class="showhide"><i class="fa fa-chevron-up"></i></a>
            </div>
            操作流程
        </div>

        <div class="panel-body no-padding">
            <div class="table-responsive">
              <table class="table table-striped table-bordered table-hover">
                  <thead>
                  <tr>
                      <g:sortableColumn property="name" title="名称"/>
                      <g:sortableColumn property="workflow" title="描述"/>
                      <g:sortableColumn property="stage" title="结果"/>
                      <g:sortableColumn property="status" title="操作人"/>
                      <g:sortableColumn property="createdDate" title="时间"/>
                  </tr>
                  </thead>
                  <tbody>
                  <g:each in="${opportunityFlows}">
                  <g:if test="${it?.status?.name == 'Pending'}">
                  <g:each in="${com.next.WorkflowInstanceStage.findAllByInstance(it)}" var="stage">
                      <tr>
                          <td>
                            ${stage?.name}
                          </td>
                          <td>${stage?.name}</td>
                          <td><g:if test="${stage?.processed}">通过</g:if></td>
                          <td>${com.next.WorkflowInstanceUser.findByStage(stage)?.user}</td>
                          <td>${stage?.startTime}</td>
                      </tr>
                      </g:each>
                      </g:if>
                  </g:each>
                  </tbody>
              </table>
            </div>
        </div>
    </div>
</div>

    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                        <g:link class="btn btn-info btn-xs" controller="opportunityTeam" action="create"
                                params="[opportunity: this.opportunity?.id]"><i class="fa fa-plus"></i>新增</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                用户
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="user"
                                              title="${message(code: 'opportunityTeam.user.label', default: '用户名')}"></g:sortableColumn>
                            <g:sortableColumn property="createDate"
                                              title="${message(code: 'opportunityTeam.createDate.label', default: '创建时间')}"></g:sortableColumn>

                            <g:sortableColumn property="modifiedDate"
                                              title="${message(code: 'opportunityTeam.modifiedDate.label', default: '修改时间')}"></g:sortableColumn>
                            <g:sortableColumn property="opportunityLayout"
                                              title="${message(code: '布局')}"></g:sortableColumn>
                                <g:sortableColumn width="8%" class="text-center" property="option"
                                                  title="${message(code: '操作')}"></g:sortableColumn>

                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${this.opportunityTeams}">
                            <tr>
                                <td><span class="nameFormat">${it.user}</span></td>
                                <td>
                                    <g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${it.createdDate}"/>
                                </td>
                                <td>
                                    <g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${it.modifiedDate}"/>
                                </td>
                                <td>${it?.opportunityLayout?.description}</td>
                                    <td width="8%" class="text-center">
                                        <g:form resource="${it}" method="DELETE">
                                            <button class="deleteBtn btn btn-danger btn-xs btn-outline" type="button"><i
                                                    class="fa fa-trash-o"></i> 删除</button>
                                        </g:form>
                                    </td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>





    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                        <g:link class="btn btn-info btn-xs" controller="workflowInstance" action="create"
                                params="[opportunity: this.opportunity?.id]"><i class="fa fa-plus"></i>新增</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                工作流
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                  <table class="table table-striped table-bordered table-hover">
                      <thead>
                      <tr>
                          <g:sortableColumn property="name" title="名称"/>
                          <g:sortableColumn property="workflow" title="工作流"/>
                          <g:sortableColumn property="stage" title="当前阶段"/>
                          <g:sortableColumn property="status" title="当前状态"/>
                          <g:sortableColumn property="createdDate" title="创建时间"/>
                          <g:sortableColumn property="modifiedDate" title="修改时间"/>
                          <g:sortableColumn property="operation" class="text-center" title="操作"/>
                      </tr>
                      </thead>
                      <tbody>
                      <g:each in="${opportunityFlows}">
                          <tr>
                              <td>
                                <sec:ifAllGranted roles="ROLE_ADMINISTRATOR">
                                <g:link controller="workflowInstance" action="show"
                                          id="${it?.id}">${it?.name}</g:link>
                                </sec:ifAllGranted>
                                <sec:ifNotGranted roles="ROLE_ADMINISTRATOR">
                                ${it?.name}
                                </sec:ifNotGranted>
                              </td>
                              <td>${it?.workflow?.name}</td>
                              <td>${it?.stage?.name}</td>
                              <td>${it?.status?.name}</td>
                              <td>${it?.createdDate}</td>
                              <td>${it?.modifiedDate}</td>
                              <td class="text-center">
                                <g:link class="btn btn-info btn-xs" controller="workflowInstance" id="${it?.id}"
                                        action="reject"><i class="fa fa-arrow-up"></i> 上一步</g:link>
                                <g:link class="btn btn-info btn-xs" controller="workflowInstance" id="${it?.id}"
                                        action="approve"><i class="fa fa-arrow-down"></i> 下一步</g:link>
                                <g:link class="btn btn-danger btn-xs" controller="workflowInstance" id="${it?.id}"
                                                action="cancel"><i class="fa fa-exclamation-circle"></i> 失败</g:link>
                                <g:link class="btn btn-success btn-xs" controller="workflowInstance" id="${it?.id}"
                                        action="complete"><i class="fa fa-check"></i> 完成</g:link>
                              </td>
                          </tr>
                      </g:each>
                      </tbody>
                  </table>
                </div>
            </div>
        </div>
    </div>

</div>


<script>
    $(function () {
        $("body").addClass("fixed-small-header");
    });
</script>
</body>

</html>
